<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE>
<html>
   <head>
   	   <meta charset="utf8">
   	   <meta name="viewport" content="width=device-width, initial-scale=1">
       <link rel="stylesheet" type="text/css" href="/aquaticproduct/Public/css/bootstrap.min.css">
       <link rel="stylesheet" type="text/css" href="/aquaticproduct/Public/css/sticky-footer-navbar.css">
       <script type="application/javascript" src="/aquaticproduct/Public/js/jquery-1.11.1.min.js"></script>
       <script type="application/javascript" src="/aquaticproduct/Public/js/bootstrap.min.js"></script>
   	   <title>水产品质量溯源系统</title>

   </head>
<body>
    <!-- Fixed navbar -->
    <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
      <div class="container">
	        <div class="navbar-header">
	          <button type="button" class="navbar-toggle" data-toggle="collapse" 
		         data-target="#navbar">
		         <span class="sr-only">切换导航</span>
		         <span class="icon-bar"></span>
		         <span class="icon-bar"></span>
		         <span class="icon-bar"></span>
		      </button>
	          <a class="navbar-brand" href="<?php echo U('Home/Index/iindex');?>">水产品质量溯源系统</a>
	        </div>
	        <div id="navbar" class="collapse navbar-collapse" >
	          <ul class="nav navbar-nav">
	            <li class="dropdown">
	            	<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">个人中心<span class="caret"></span></a>
	            	   <ul class="dropdown-menu">
		                <li><a href="<?php echo U('Home/User/showMe',array('role'=> '3'));?>">个人信息</a></li>
		                <li ><a href="<?php echo U('Home/Index/logout');?>" style="color:red">退出</a></li>	
		              </ul>
	            </li> 

	            <li class="dropdown">
	              <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">功能列表 <span class="caret"></span></a>
	              <ul class="dropdown-menu">
	                <li><a href="<?php echo U('Home/Safe/index');?>">养殖基本信息</a></li>
					<li><a href="<?php echo U('Home/Safe/cultivation', array('name'=>'stocking'));?>">养殖管理</a></li>
	                <li><a href="#">出塘管理</a></li>
	                <li><a href="#">质量追溯</a></li>	                
	              </ul>
	            </li>
	              <li><a href="<?php echo U('Home/Test/test', array('name' => 'qrcode'));?>">自动化录入信息</a></li>
	          </ul>
	        </div><!--/.nav-collapse -->
      </div>
    </nav>
    
    <div class="container">
    	<div class="row">
    		<div class="col-sm-9">
    		  

<div class="panel panel-info">
       <div class="panel-heading">
          <h3 class="panel-title">
             地理位置
          </h3>
       </div>
       <div class="panel-body">
              <div class="form-group">
                <button class="btn btn-primary" id="address">获取地理位置</button>
              </div>
              
              <button id="submit" class="btn btn-primary">提交</button>
       </div>

</div>

    		</div>

	       <div class="col-sm-3">
	       	   
  <h1><strong>自动化</strong></h1>
      <ul class="nav nav-pills nav-stacked">
        <li ><a href="<?php echo U('Home/Safe/test', array('name'=>'qrcode'));?>">二维码</a></li>
        <li class="active"><a href="<?php echo U('Home/Safe/test', array('name'=> 'address'));?>">地理位置</a></li>
        <li><a href="<?php echo U('Home/Safe/test', array('name' => 'picture'));?>">拍照</a></li>
      </ul>

	       </div>
	    </div> <!-- row -->
    	
   </div> <!-- container -->

   
    <footer class="footer">
      <div class="container">
        <p class="text-muted"><center>Copyright by 华南农业大学</center></p>
      </div>
    </footer>
    
  </body>
</html>


<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script>
    wx.config({
        debug: false,
        appId: '<?php echo ($signPackage["appId"]); ?>',
        timestamp: '<?php echo ($signPackage["timestamp"]); ?>',
        nonceStr: '<?php echo ($signPackage["nonceStr"]); ?>',
        signature: '<?php echo ($signPackage["signature"]); ?>',
        jsApiList: [
            'checkJsApi',
            'getLocation'
        ]
    });
    wx.ready(function () {

        $("#address").click(function() { 

             wx.getLocation({
              type: 'wgs84', // 默认为wgs84的gps坐标，如果要返回直接给openLocation用的火星坐标，可传入'gcj02'
              success: function (res) {
                  var latitude = res.latitude; // 纬度，浮点数，范围为90 ~ -90
                  var longitude = res.longitude; // 经度，浮点数，范围为180 ~ -180。
                  var speed = res.speed; // 速度，以米/每秒计
                  var accuracy = res.accuracy; // 位置精度
              }
            });
        });
        
     });
</script>